package com.zhg.javakc.modules.purchase.service;

/**
 * @author an
 * @version v0.0.1
 * @date 2019/11/22 20:13
 */

import com.zhg.javakc.base.page.Page;
import com.zhg.javakc.base.service.BaseService;
import com.zhg.javakc.modules.purchase.dao.PurchaseDao;
import com.zhg.javakc.modules.purchase.entity.PurchaseEntity;
import com.zhg.javakc.modules.supplier.dao.SupplierDao;
import com.zhg.javakc.modules.supplier.entity.SupplierEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 采购价逻辑层
 */

@Service
public class PurchaseService extends BaseService<PurchaseDao, PurchaseEntity> {

    @Autowired
    PurchaseDao purchaseDao;

    public Page<PurchaseEntity> query(PurchaseEntity purchaseEntity,Page<PurchaseEntity> page)
    {
        //设置分页参数，才会被mybatis分页插件所识别，在其SQL的前后加入分页SQL语句
        purchaseEntity.setPage(page);
        //根据分页与查询条件进行测试数据的查询
        List<PurchaseEntity> testList = purchaseDao.findList(purchaseEntity);
        //将查询数据设置到分页类的list集合中，一起返回
        page.setList(testList);
        return page;
    }


    public List<Map<String,Object>> querySupplier()
    {
        return purchaseDao.querySupplier();
    }




}
